
"""
  这种情况并不成立，会抛出UnboundLocalError: local variable 'x' referenced before assignment
"""
x = 0  
def used_iter():
    x+=2
    return x
for i in iter(used_iter,12):
    print(i)